package com.ybkj.o2o.zhuanche.entity;

import com.ybkj.o2o.zhuanche.common.json.DateTimeJsonSerializer;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;

import java.io.Serializable;
import java.util.Date;


/**
 * 充值临时记录对象.
 * @author hqb
 */
public class PayRecordOrder implements Serializable {
  private Long id; // 真实记录
  @JsonSerialize(using = DateTimeJsonSerializer.class)
  private Date created; // 创建时间
  @JsonSerialize(using = DateTimeJsonSerializer.class)
  private Date updated; // 修改时间

  private Long orderId; // 订单Id

  private Double money; // 金额

  private String payRecordTypeOrder; // 支付方式

  private Boolean treatment; // 是否交易成功

  private static final long serialVersionUID = 1L;

  public Long getId() {
    return id;
  }

  public void setId(Long id) {
    this.id = id;
  }

  public Date getCreated() {
    return created;
  }

  public void setCreated(Date created) {
    this.created = created;
  }

  public Date getUpdated() {
    return updated;
  }

  public void setUpdated(Date updated) {
    this.updated = updated;
  }

  public Long getOrderId() {
    return orderId;
  }

  public void setOrderId(Long orderId) {
    this.orderId = orderId;
  }

  public Double getMoney() {
    return money;
  }

  public void setMoney(Double money) {
    this.money = money;
  }

  public String getPayRecordTypeOrder() {
    return payRecordTypeOrder;
  }

  public void setPayRecordTypeOrder(String payRecordTypeOrder) {
    this.payRecordTypeOrder = payRecordTypeOrder == null ? null : payRecordTypeOrder.trim();
  }

  public Boolean getTreatment() {
    return treatment;
  }

  public void setTreatment(Boolean treatment) {
    this.treatment = treatment;
  }

  @Override
  public boolean equals(Object that) {
    if (this == that) {
      return true;
    }
    if (that == null) {
      return false;
    }
    if (getClass() != that.getClass()) {
      return false;
    }
    PayRecordOrder other = (PayRecordOrder) that;
    return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
        && (this.getCreated() == null ? other.getCreated() == null : this.getCreated().equals(
            other.getCreated()))
        && (this.getUpdated() == null ? other.getUpdated() == null : this.getUpdated().equals(
            other.getUpdated()))
        && (this.getOrderId() == null ? other.getOrderId() == null : this.getOrderId().equals(
            other.getOrderId()))
        && (this.getMoney() == null ? other.getMoney() == null : this.getMoney().equals(
            other.getMoney()))
        && (this.getPayRecordTypeOrder() == null ? other.getPayRecordTypeOrder() == null : this
            .getPayRecordTypeOrder().equals(other.getPayRecordTypeOrder()))
        && (this.getTreatment() == null ? other.getTreatment() == null : this.getTreatment()
            .equals(other.getTreatment()));
  }

  @Override
  public int hashCode() {
    final int prime = 31;
    int result = 1;
    result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
    result = prime * result + ((getCreated() == null) ? 0 : getCreated().hashCode());
    result = prime * result + ((getUpdated() == null) ? 0 : getUpdated().hashCode());
    result = prime * result + ((getOrderId() == null) ? 0 : getOrderId().hashCode());
    result = prime * result + ((getMoney() == null) ? 0 : getMoney().hashCode());
    result =
        prime * result
            + ((getPayRecordTypeOrder() == null) ? 0 : getPayRecordTypeOrder().hashCode());
    result = prime * result + ((getTreatment() == null) ? 0 : getTreatment().hashCode());
    return result;
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append(getClass().getSimpleName());
    sb.append('[');
    sb.append("Hash = ").append(hashCode());
    sb.append(", id=").append(id);
    sb.append(", created=").append(created);
    sb.append(", updated=").append(updated);
    sb.append(", orderId=").append(orderId);
    sb.append(", money=").append(money);
    sb.append(", payRecordTypeOrder=").append(payRecordTypeOrder);
    sb.append(", treatment=").append(treatment);
    sb.append(", serialVersionUID=").append(serialVersionUID);
    sb.append(']');
    return sb.toString();
  }
}
